<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title>06_for_of循环</title>
</head>
<body>
<!--
for(let value of target){} 循环遍历
  1. 遍历数组
  2. 遍历 Set
  3. 遍历 Map
  4. 遍历字符串
  5. 遍历伪数组
-->
<button>按钮1</button>
<button>按钮2</button>
<button>按钮3</button>
<script type="text/javascript">
  let arr = [1, 2, 3, 4, 5];
  for (let num of arr) {
    console.log(num);
  }
  let set = new Set([1, 2, 3, 4, 5]);
  for (let num of set) {
    console.log(num);
  }
  let str = 'abcdefg';
  for (let num of str) {
    console.log(num);
  }
  let btns = document.getElementsByTagName('button');
  for (let btn of btns) {
    console.log(btn.innerHTML);
  }
</script>
</body>
</html>
